<style>
	table{
		width:600px;
		text-align:center;
		border-collapse:collapse;
	}
	table tr td{
		height:45px;
		border:1px solid #999;
	}
	textarea{
		height:100px;
		width:400px;
		resize:none;
	}
</style>
<form action="/index.php/Admin/Goods/addck" method="POST" enctype="multipart/form-data">
	<table>
		<tr>
			<td colspan="2">
				添加商品
			</td>
		</tr>
		<tr>
			<td>商品名</td>
			<td>
				<input type="text" name='name'>
			</td>
		</tr>
		<tr>
			<td>商品编号</td>
			<td>
				<input type="text" name='gid'>
			</td>
		</tr>
		<tr>
			<td>分类</td>
			<td>
				<select name='cid'>
<?php
	foreach ($cateData as $val):
?>
<?php
	if($val['pid']==0):
?>
					<optgroup label="<?php echo $val['name'] ?>">
<?php
	else:
?>
					<option value="<?php echo $val['id']?>"><?php echo $val['name'] ?></option>
<?php 
	endif;
?>
<?php
	if($val['pid']==0):
?>
					</optgroup>
<?php
	endif;
?>
<?php
	endforeach;
?>
				</select>
			</td>
		</tr>
		<tr>
			<td>品牌</td>
			<td>
				<select name='bid'>
<?php
	foreach ($brandData as $val):
?>
					<option value="<?php echo $val['id']?>"><?php echo $val['name'] ?></option>
<?php
	endforeach;
?>
				</select>
			</td>
		</tr>
		<tr>
			<td>市场价</td>
			<td>
				<input type="text" name='market'>
			</td>
		</tr>
		<tr>
			<td>本店价</td>
			<td>
				<input type="text" name='price'>
			</td>
		</tr>
		<tr>
			<td>积分</td>
			<td>
				<input type="text" name='score' value="10">
			</td>
		</tr>
		<tr>
			<td>描述</td>
			<td>
				<textarea name='brief'>无</textarea>
			</td>
		</tr>
		<tr>
			<td>上传图片</td>
			<td>
				<input type="file" name="photo" />
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="hidden" name="sales" value="0">
				<input type='submit' value="添加" />
			</td>
		</tr>
	</table>
</form>